
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import './public/common/var.css'
import './public/common/commons.css'
import './public/common/drag.css'
import App from './App.vue'
import router from './router';
//引入路由守卫
import './router/route-guard.js';
import baseControl, { I18Parse, layer, VueBus, MessageBox, VxeTable } from '@lowcode/jpaas-base-lib';
import { VxeTooltip, VxeLoading } from 'vxe-pc-ui'

const app = createApp(App)
app.use(createPinia())
app.use(router)
app.use(VxeTable).use(VxeTooltip).use(VxeLoading)

//引入ant design vue
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/reset.css';
import * as Icon from '@ant-design/icons-vue';
app.use(Antd)
//全局注入Ant design 图标;
for (let key in Icon) {
    app.component(key, Icon[key])
}

/*引入svg图标*/
import  '../public/iconfont-svg/fill/iconfont.js'
import  '../public/iconfont-svg/line/iconfont.js'
import  '../public/iconfont-svg/color/iconfont.js'

//语言包
import i18n from './language'
app.use(i18n);
app.config.globalProperties.$t = i18n.global.t;
//国际化语言解析
app.use(I18Parse);

//引入layer  jpaas-base-lib
app.use(layer)
import '@lowcode/jpaas-base-lib/lib/style.css'
app.use(baseControl);
//bus
app.config.globalProperties.$msg=MessageBox;
app.config.globalProperties.$bus=VueBus;

//引入自由拖拽
//import {rxDrag,rxDragList} from 'rx-drag'
import RxDrag from 'rx-drag'
app.use(RxDrag)
/*引入monaco相关语言及提示*/
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';

window.monacoWorkConfig = {
    jsonWorker,
    cssWorker,
    htmlWorker,
    tsWorker,
    EditorWorker
}
/*引入monaco相关语言及提示 end*/

//百度富文本编辑器
import VueUeditorWrap from 'vue-ueditor-wrap';
app.use(VueUeditorWrap);

//拖拽组件
import VueGridLayout from 'vue-grid-layout'
app.use(VueGridLayout)

//引入share-component里的组件
import shareControl from '@lowcode/jpaas-share-component';
import '@lowcode/jpaas-share-component/lib/style.css'
app.use(shareControl);

window.app = app
app.mount('#app')
